import { createWebHashHistory,createRouter } from "vue-router";
import todolist from "../components/todolist.vue"
import index from "../components/index.vue"
import introduction from "../components/introduction.vue"

const routes=[
{path:"/list",component:todolist},
//path为空会一直显示嵌套路由
// {path:"/:index",components:{sidebar:User}},
{path:"/:introduction(\\d)*",component:introduction},
{path:"/:index",component:index},
]
//其实path分号上的是个形参,就introduction的路径来说可以有0或多个参数，而且需要0或1的数字
const router=createRouter({history:createWebHashHistory(),routes})
// router.resolve({name:"introduction",params:{introduction:[]}}).href
export default router
